feat: add PhoneService, PhoneAPIKeyService, and WebhookService#5
Merged
AchoArnold merged 3 commits intomainfrom May 5, 2026
Merged
feat: add PhoneService, PhoneAPIKeyService, and WebhookService#5AchoArnold merged 3 commits intomainfrom
AchoArnold merged 3 commits intomainfrom
Conversation
- PhoneService: Upsert() and UpsertFCMToken() for phone management - PhoneAPIKeyService: Store() for creating phone API keys - WebhookService: Store() for creating webhooks with signing keys - Register new services on Client struct Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add success, error, and request verification tests for all new service methods introduced in this branch: - PhoneService.Upsert and PhoneService.UpsertFCMToken - PhoneAPIKeyService.Store - WebhookService.Store Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR expands the Go SDK with new write-side services for provisioning phones, phone API keys, and webhooks, which fits the SDK’s role as a thin client over the httpSMS API and supports the integration tests’ need to create these resources programmatically.
Changes:
- Registers
Phones,PhoneAPIKeys, andWebhookson the sharedClient. - Adds models and service methods for phone upsert/FCM token binding, phone API key creation, and webhook creation.
- Adds stub-backed unit tests for the new services and updates the
google/uuiddependency version.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
client.go |
Wires the three new services into client construction. |
phone.go |
Adds the phone resource model and response wrapper. |
phone_service.go |
Adds phone upsert and FCM-token endpoints. |
phone_service_test.go |
Adds success, error, and request-shape tests for phone APIs. |
phone_api_key.go |
Adds the phone API key resource model and response wrapper. |
phone_api_key_service.go |
Adds the phone API key creation endpoint. |
phone_api_key_service_test.go |
Adds tests for phone API key creation behavior. |
webhook.go |
Adds the webhook resource model and response wrapper. |
webhook_service.go |
Adds the webhook creation endpoint. |
webhook_service_test.go |
Adds tests for webhook creation behavior. |
internal/stubs/phone.go |
Adds phone endpoint stub payloads. |
internal/stubs/phone_api_key.go |
Adds phone API key stub payloads. |
internal/stubs/webhook.go |
Adds webhook stub payloads. |
go.mod |
Bumps github.com/google/uuid to v1.6.0. |
go.sum |
Refreshes checksums for the dependency bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+19
| PhoneNumber string `json:"phone_number"` | ||
| FcmToken string `json:"fcm_token,omitempty"` | ||
| MessagesPerMinute uint `json:"messages_per_minute,omitempty"` | ||
| MaxSendAttempts uint `json:"max_send_attempts,omitempty"` | ||
| MessageExpirationSeconds uint `json:"message_expiration_seconds,omitempty"` | ||
| SIM string `json:"sim,omitempty"` |
Comment on lines
+20
to
+22
| // Store adds a new webhook | ||
| func (service *WebhookService) Store(ctx context.Context, params *WebhookStoreParams) (*WebhookResponse, *Response, error) { | ||
| request, err := service.client.newRequest(ctx, http.MethodPost, "/v1/webhooks", params) |
Comment on lines
+28
to
+30
| Phones *PhoneService | ||
| PhoneAPIKeys *PhoneAPIKeyService | ||
| Webhooks *WebhookService |
|
|
||
| // Store adds a new phone api key | ||
| func (service *PhoneAPIKeyService) Store(ctx context.Context, params *PhoneAPIKeyStoreParams) (*PhoneAPIKeyResponse, *Response, error) { | ||
| request, err := service.client.newRequest(ctx, http.MethodPost, "/v1/phone-api-keys/", params) |
Member
Author
|
All 4 review comments have been addressed in commits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three new services to the SDK for managing phones, phone API keys, and webhooks programmatically.
New Services
Changes
These are needed by the httpSMS integration test suite to dynamically create phones and webhooks per test.